new Vue({
  el: "#app",
  data() {
    return {
      html: "",
      loading: false,
      form: {
        Company_History_SerialNumber: "",
        Company_History_Title: "",
        Company_History_Main: "",
        Company_History_Date: "",
      },
    };
  },
  mounted() {},
  methods: {
    back() {
      window.history.go(-1);
    },
    subMessage() {
      console.log(this.form);
      let lArray = new Array();
      lArray.push(this.form);
      let lJSONObject_company_history = new Object();
      lJSONObject_company_history.company_history = lArray; //换表
      let lJSONObject_DataSet = new Object(); // Modify
      lJSONObject_DataSet.Add = lJSONObject_company_history; //换表
      //   return;
      this.loading = true;
      const _this = this;

      $.ajax({
        // url: DomainName + "/GoodsFileAdd",
        url: "https://service.kdddy.cn/donghui/clientOperation/generalSaveForClient",
        type: "POST",
        data: {
          Data: JSON.stringify(lJSONObject_DataSet),
        },
        success: function (res) {
          console.log("提交结果", res);
          if (res.Status == "success") {
            _this.$message.success("发布成功!");
            _this.loading = false;
            window.history.go(-1);
          }
        },
        error: function () {
          _this.$message.error("操作失败，请稍后再试");
        },
        complete: function (XMLHttpRequest) {
          _this.loading = false;
          if (XMLHttpRequest.getResponseHeader("REDIRECT") == "REDIRECT") {
            window.parent.document.location.href =
              "../../../" + XMLHttpRequest.getResponseHeader("CONTENTPATH");
          }
        },
      });
    },
  },
});
